package simple02;


import simple02.factory.AppleFactory;
import simple02.factory.FruitFactory;
import simple02.friut.Fruit;

//工厂方法模式
public class Simple {
    private static FruitFactory fruitFactory;
    public static void main(String[] args) {
        fruitFactory = new AppleFactory();
        peterdo();
        peterdo2();
    }

    public static void peterdo(){
        Fruit fruit = fruitFactory.getFruit();
        fruit.fruit();
        System.out.println("----");
    }

    public static void peterdo2(){
        Fruit fruit = fruitFactory.getFruit();
        fruit.fruit();
        System.out.println("----");
    }
}
